package com.example.zju_bytedance_android_hw1;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final EditText editText_name=(EditText)findViewById(R.id.getName);

        Button button_confirm=(Button)findViewById(R.id.confirmButton);
        button_confirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String data=editText_name.getText().toString();
                Intent intent=new Intent(MainActivity.this,Function.class);
                intent.putExtra("inName",data);
                Log.d(TAG, "onClick: Will jump to second activity");
                startActivity(intent);
            }
        });
    }
}
